package finalproject;

import java.lang.reflect.InvocationTargetException;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import finalproject.config.Ressource;
import finalproject.controller.Game;
import finalproject.model.rooms.Mapper;
import finalproject.view.GameView;
import finalproject.view.StringManager;
import finalproject.view.parser.Parser;

/**
 * Entry point of the project
 * Main class of the project, load the i18n file, create the map, the view and launch the game
 * @author Nicolas Bighetti
 *
 */
public abstract class Main {

	public static void main(String[] args) throws InvocationTargetException, InterruptedException,
			ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException
	{
		// Init the string manager
		StringManager.loadLocale("en", "US");

		// Create map
		Mapper mapper = new Mapper(Ressource.getRoomList());
		mapper.createMap();
		
		// Init view
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		GameView gv = new GameView(mapper);

		// Start the game
		new Game(new Parser(), mapper.getStartingRoom(), gv, "Henri", "Bob").play();
		gv.displayView();
	}
}
